<template>
	<view class="flex-col page">
	 <scroll-view scroll-y="true" v-if="orders.length>0" style="height:calc(100vh)-40px;" @scrolltolower="loadmore">
		<view class="flex-col group_3" >
			<view class="flex-col">
			<view class="flex-col list" v-if="orders.length!=0">
					<view class="flex-col list-item" :key="i" v-for="(item, i) in orders"  @click.stop="seeexplan(item)">
						<view class="share" v-if="item.foremanId">
                          <text @click.stop.stop="shareFriend(item.ordersId)">分享邀请工长</text>

						</view>
						<view class="justify-between group_6">
							<text class="text_7">订单编号：{{item.ordersNumber}}</text>
							<text class="text_9" v-if="item.ordersStatus == 1">待付款</text>
							<text class="text_9" v-else-if="item.ordersStatus == 2">待完善</text>
							<text class="text_9" v-else-if="item.ordersStatus == 3">进行中</text>
							<text class="text_9" v-else-if="item.ordersStatus == 4">待评价</text>
							<text class="text_9" v-else-if="item.ordersStatus == 5">已完成</text>
							<text class="text_9" v-else>已取消</text>
						</view>
						<text class="text_11" v-if="item.ordersType ==1">全流程咨询</text>
						<text class="text_11" v-else-if="item.ordersType ==2">设计优化</text>
						<text class="text_11" v-else-if="item.ordersType ==3">审核/合同签约</text>
						<text class="text_11" v-else-if="item.ordersType ==4">主材咨询</text>
						<text class="text_11" v-else-if="item.ordersType ==5">施工巡检</text>
						<text class="text_11" v-else-if="item.ordersType ==6">验收</text>
						<text class="text_11" v-else-if='item.ordersType ==7'>选材咨询</text>
						<text class="text_11" v-else-if='item.ordersType ==8'>全流程管家</text>
						<!-- <text class="text_13" v-if="item.ordersType ==1">全流程服务</text> -->
						<view class="flex-row group_7">
							<text class="text_15">应付款:</text>
							<view class="group_8">
								<text class="text_17">￥</text>
								<text class="text_19">{{item.payableMoney}}</text>
							</view>
						</view>
					
					
						<view class="justify-end  group_9" v-if="item.ordersStatus == 5">
						
							<view class="flex-col items-center text-wrapper" @click.stop="seeexplan(item)"><text
									class="text_21">查看详情</text></view>
							<!-- <view class="flex-col items-center text-wrapper" @click.stop="changeorderStatus(item.ordersId)">
								<text class="text_21">完成订单</text>
							</view> -->
						</view>
						<!-- 待评价 -->
						<view class="justify-end  group_9" v-if="item.ordersStatus == 4">
						
							<view class="flex-col items-center text-wrapper" @click.stop="seeexplan(item)"><text
									class="text_21">查看详情</text></view>
							<view class="flex-col items-center text-wrapper_2" @click.stop="evaluate(item.ordersId)"><text
									class="text_25">评价</text></view>
							<!-- <view class="flex-col items-center text-wrapper"><text class="text_21">合同反馈</text></view> -->
						</view>
					
					</view>
				</view>
				<view class="flex-col listnone" v-else>
					<u-empty style="height: 89vh;" width="250"   mode="data" textSize="30rpx"
						icon="http://cdn.uviewui.com/uview/empty/order.png">
					</u-empty>
				</view>
			</view>
		</view>
		 	  <u-loadmore v-show="more" height="100"  fontSize="26" :status="status" />
	 </scroll-view>
	 <view style="height:100vh;" class="u-flex-col u-row-center u-col-center" v-else>
	 	<u-empty mode="data"></u-empty>
	 </view>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	export default {
		components: {},
		created() {
		
			this.myordersL();
			
		},
		data() {
			return {
			more:false,
					
			status: 'loading',
				index: 0,
				orders: [],
				show: false,
			
				param:{
					pageSize:10,
					pageNum:1,
					ordersStatus:'4'
				},
			};
		},
		
		computed: {
			...mapGetters(['userInfo'])
		},
		methods: {
			loadmore()
			{
							 this.status="loading";
							 this.more=true;
							this.param.pageNum++;
							this.myordersL(1)
			},
			
			myordersL(type=0) {
				this.$http('mine.myordersL', this.param).then(res => {
					if (res.code == 200) {
						if(type==0)
						{
							this.orders = res.data;
						}else{
							
							if(res.data.length>0)
							{
								 this.orders=this.orders.concat(res.data);
								 this.status="loadmore";
							}else{
								this.status="nomore";
								
							}
							
						}
						
					}
				}).catch(err => {

				})
			},
			seeexplan(item) {
				// 1全流程咨询 2设计优化 3审核/合同签约 4主材咨询 5施工巡检 6验收 7选材咨询 8全流程管家
				if (item.ordersType == 2) {
					// 设计优化
					uni.navigateTo({
						url: '/pages/my/order/orderDetail6?ordersId=' + item.ordersId + '&ordersStatus=' + item
							.ordersStatus
					})
				} else if (item.ordersType == 1) {
					// 全流程咨询
					uni.navigateTo({
						url: '/pages/my/order/orderDetail?ordersId=' + item.ordersId + '&ordersStatus=' + item
							.ordersStatus
					})
				} else if (item.ordersType == 3) {
					// 审核 合同签约
					uni.navigateTo({
						url: '/pages/my/order/orderDetail5?ordersId=' + item.ordersId + '&ordersStatus=' + item
							.ordersStatus
					})
				} else if (item.ordersType == 4) {
					// 主材咨询
					// this.$u.toast('敬请期待');
					uni.navigateTo({
						url: '/pages/my/order/orderDetailZC?ordersId=' + item.ordersId + '&ordersStatus=' + item
							.ordersStatus
					})
				} else if (item.ordersType == 5) {
					// 施工巡检
					uni.navigateTo({
						url: '/pages/my/order/orderDetail4?ordersId=' + item.ordersId + '&ordersStatus=' + item
							.ordersStatus
					})
				} else if (item.ordersType == 6) {
					// 验收
					uni.navigateTo({
						url: '/pages/my/order/orderDetail2?ordersId=' + item.ordersId + '&ordersStatus=' + item
							.ordersStatus
					})
				} else if (item.ordersType == 7) {
					// 选材咨询
					// this.$u.toast('敬请期待');
					uni.navigateTo({
						url: '/pages/my/order/orderDetailXC?ordersId=' + item.ordersId
					})
				} else if (item.ordersType == 8) {
					// 全流程管家
					uni.navigateTo({
						url: '/pages/my/order/orderDetail8?ordersId=' + item.ordersId
					})
				}

			},
			
			// 去评价
			evaluate(item) {
				uni.navigateTo({
					url: '/pages/my/evaluate/evaluate?ordersId=' + item
				})
			},
		
		},
	};
</script>

<style scoped lang="scss">
	.listnone {
		font-size: 30rpx;
		text-align: center;
		line-height: 100rpx;
		color: #999;
	}

	.list-item {
		position: relative;
	}

	.share {
		position: absolute;
		top: 120rpx;
		right: 0px;
		padding: 5rpx 0 15rpx;
		background-image: linear-gradient(90deg, #1d6aff33 0%, #1d6aff33 8.92%, #0f358000 100%, #0f358000 100%);
		border-radius: 24rpx 0px 0px 24rpx;
		width: 184rpx;
		height: 48rpx;
		text-align: center;
		line-height: 38rpx;
	}

	.share text {
		color: #1d6aff;
		font-size: 24rpx;
	}

	.tab-bar {
		background-color: #ffffff;
		padding: 0 20rpx;
	}

	/deep/ .u-tabs__wrapper__nav__line {
		left: 35rpx;
	}

	.list-item {
		padding-left: 24rpx;
		padding-right: 23rpx;
		background-color: #ffffff;
		border-radius: 16rpx;
	}

	.group_6 {
		padding: 30rpx 0 35rpx;
		border-bottom: solid 1rpx #eeeeee;
	}

	.text_11 {
		margin-top: 30rpx;
		align-self: flex-start;
		color: #333333;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_13 {
		margin-top: 22rpx;
		align-self: flex-start;
		color: #999999;
		font-size: 24rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 28rpx;
	}

	.group_7 {
		margin-top: 34rpx;
	}

	.group_9 {
		margin-top: 22rpx;
		padding: 25rpx 0 31rpx;
		border-top: solid 1rpx #eeeeee;
	}

	.text_7 {
		margin-top: 6rpx;
		color: #666666;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_9 {
		margin-bottom: 6rpx;
		color: #1d6aff;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_15 {
		margin: 7rpx 0 3rpx;
		color: #666666;
		font-size: 24rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 28rpx;
	}

	.group_8 {
		margin-left: 17rpx;
		height: 38rpx;
	}

	.text-wrapper {
		margin-right: 20rpx;

		background-color: #f6f7f9;
		border-radius: 24rpx;
		width: 148rpx;
		height: 48rpx;
		line-height: 48rpx;
	}

	.text-wrapper_1 {
		margin-right: 20rpx;

		background-color: #f6f7f9;
		border-radius: 24rpx;
		width: 148rpx;
		height: 48rpx;
	}

	.text-wrapper_2 {

		background-color: #1d6aff;
		border-radius: 24rpx;
		width: 148rpx;
		height: 48rpx;
		line-height: 48rpx;
	}

	.text_17 {
		color: #fe641a;
		font-size: 20rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 23rpx;
	}

	.text_19 {
		color: #fe641a;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
	}

	.text_21 {
		color: #333333;
		font-size: 24rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 48rpx;
	}

	.text_23 {
		color: #333333;
		font-size: 24rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 28rpx;
	}

	.text_25 {
		color: #ffffff;
		font-size: 24rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 48rpx;
	}

	.back-w {
		display: flex;
		flex-direction: row;
		padding-top: 50rpx;
		/* align-items: center; */
		width: 100vw;
		height: 90rpx;
		background-color: #ffffff;
	}

	.f-w-l {
		display: flex;
		flex-direction: row;
		font-weight: bold;
		margin-left: 33%;
	}

	.page {
		background-color: #f6f7f9ff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group_3 {
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.list {
		padding: 24rpx 24rpx 17rpx;
	}

	.group_4 {
		overflow-x: hidden;
	}

	.section_4 {
		margin-left: 3rpx;
		margin-top: 27rpx;
		align-self: flex-start;
		background-color: #1d6aff;
		border-radius: 4rpx;
		width: 50rpx;
		height: 8rpx;
	}

	.list-item:not(:first-of-type) {
		margin-top: 20rpx;
	}

	.group_5 {
		flex-shrink: 0;
		width: 188rpx;
	}

	.text_3 {
		margin-left: 59rpx;
		flex-shrink: 0;
		color: #666666;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_4 {
		margin-left: 58rpx;
		flex-shrink: 0;
		color: #666666;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_5 {
		margin-left: 59rpx;
		flex-shrink: 0;
		color: #666666;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_6 {
		margin-left: 58rpx;
		flex-shrink: 0;
		color: #666666;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_1 {
		color: #333333;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_2 {
		color: #666666;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}
</style>
